package com.fjut.zr.judge_system.OJ.Submitter;

import com.fjut.zr.judge_system.POJO.VO.OJSubmitinfo;

public class OJSubmitterImpl implements OJSubmitter {

    @Override
    public int doSubmit(OJSubmitinfo ojSubmitinfo) {
        System.out.println("==========OJ提交信息==========");
        System.out.println("运行ID:"+ojSubmitinfo.getRid());
        System.out.println("使用测评机:"+oj_keys[ojSubmitinfo.getOjudgeId()]);
        System.out.println("题目ID:"+ojSubmitinfo.getPid());
        System.out.println("编程语言:"+oj_keys[ojSubmitinfo.getOjudgeId()]);
        System.out.println("提交的代码:"+ojSubmitinfo.getCode());
        System.out.println("===========================");
        submitInfo(ojSubmitinfo,ojSubmitinfo.getOjudgeId());//提交信息
        return 0;
    }
    private void  submitInfo(OJSubmitinfo ojsubmitInfo,int ojudgeid )
    {
        ojudge.addSubmit(ojsubmitInfo,ojudgeid);
    }
}
